package lang.object;

import entity.Student;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author LiDong
 * @version 1.0.0
 */
public class CopyObjectTest {

    private static final Logger logger = LoggerFactory.getLogger(CopyObjectTest.class);

    /**
     * 浅克隆：克隆对象自身引用的地址
     * 深克隆：克隆对象自身以及对象所包含的引用类型对象的引用地址
     **/

    @Test
    public void test1() throws CloneNotSupportedException {
        Student student = new Student("张三","1001");
        Student cloneStudent = (Student) student.clone();
        logger.info("{}",student);
        logger.info("{}",cloneStudent);
    }


}
